Component({
  props: {
    // a-tubiaoai_huaban2fuben5 | pingjia | fenleitab | icon_chose | a-tubiaoai_huaban7fuben15 | a-tubiaoai_huaban7fuben16 | a-xuanzhongsvg_huaban2fuben12 | a-tubiaoai_huaban2fuben11 | a-tubiaoai_huaban2fuben31 | a-9-9_huaban2fuben10 | a-tubiaoai_huaban2fuben9 | a-2 | a-4 | a-tubiaoai_huaban2fuben7 | a-tubiaoai_huaban2fuben4 | a-tubiaoai_huaban2fuben3 | icon_shopping_off2 | icon_shopping_on1 | icon_chakan | icon_dingdan | icon_sure | icon_news | icon_trumpet1 | icon_into | icon_car | icon_start | a-icon_minus_huaban7fuben8 | icon_labe | a-icon_next_huaban7fuben5 | icon_add1 | icon_classify_off | icon_classify_on | icon_home_off | icon_home_on | icon_me_on | icon_shopping_off | icon_me_off | icon_shopping_on | icon_shopping | icon_add
    name: null,
    // string | string[]
    color: '',
    size: 18,
  },
  data: {
    quot: '"',
    svgSize: 18,
    isStr: true,
  },
  didMount() {
    const size = this.props.size;
    const color = this.props.color;

    this.setData({
      isStr: typeof color === 'string',
    });

    if (size !== this.data.svgSize) {
      this.setData({
        svgSize: (size / 750) * my.getSystemInfoSync().windowWidth,
      });
    }
  },
  disUpdate(prevProps) {
    const size = this.props.size;
    const color = this.props.color;

    if (color !== prevProps.color) {
      this.setData({
        isStr: typeof color === 'string',
      });
    }

    if (size !== prevProps.size) {
      this.setData({
        svgSize: (size / 750) * my.getSystemInfoSync().windowWidth,
      });
    }
  },
});
